/*
 * @Author: Penk
 * @LastEditors: Penk
 * @LastEditTime: 2022-04-19 15:19:12
 * @FilePath: \明世插件\contentScripts1.js
 */

window.staticPrefix = "http://localhost:8000";
window.date = new Date().getTime() + Math.ceil(Math.random() * 10000000);

// 引入公共文件方法
function loadFile(filename, filetype = 'js', staticPrefix = window.staticPrefix) {

    if (filetype == "js") {
        var file = document.createElement('script');
        file.setAttribute("type", "text/javascript");
        file.setAttribute("src", staticPrefix + filename + '?v=' + window.date);
    } else if (filetype == "css") {
        var file = document.createElement('link');
        file.setAttribute("rel", "stylesheet");
        file.setAttribute("type", "text/css");
        file.setAttribute("href", staticPrefix + filename + '?v=' + window.date);
    }
    if (typeof file != "undefined") {
        document.getElementsByTagName("head")[0].appendChild(file);
    }
}

loadFile("/contentScripts2.js",'js');
